package cn.wolfcode.trip.api.controller;

import cn.wolfcode.trip.base.domain.Mycomment;
import cn.wolfcode.trip.base.query.MycommentQueryObject;
import cn.wolfcode.trip.base.query.QueryObject;
import cn.wolfcode.trip.base.service.IMycommentService;
import cn.wolfcode.trip.base.util.JsonResult;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 游记资源控制器
 */
@RestController
@RequestMapping("mycomments")
public class MycommentController {

    @Autowired
    private IMycommentService mycommentService;

    /**
     * 添加游记的接口
     * 1.资源 /mycomments
     * 2.请求方式 get
     * 3.请求参数 分页
     * 4.返回结果 JsonResult
     */
    @GetMapping("{userId}")
    public PageInfo list(MycommentQueryObject qo){

        return mycommentService.query(qo);
    }


}
